package com.lyc.day1031.demo2;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/10/31 17:18
 * @description：
 * @modified By：
 * @version:
 */
public class MyTicket implements Runnable{
    private int ticket=100;
    @Override
    public void run() {
        while (true){
            if (ticket>0){
                System.out.println(Thread.currentThread().getName()+"卖了一张票，剩余："+--ticket);
            }else {
                break;
            }
        }
    }
}